home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr49
/
actlib13.zip
/
TOOLS.ZIP
/
TESTDRV.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-15
|
898b
|
41 lines
/* Copyright (C) 1993 Marc Stern (internet: stern@mble.philips.be) */
#include "tools.h"
#include <bios.h>
/***
*
* Function : test_drive
*
* Topics : Test the availability of a drive.
*
* Parameters : in int drive 0 = A:, 1 = B:
*
* Return code: 0 if OK
* 2 if not formatted
* 3 if write-protected
* 128 (0x80) if floppy not inserted
* other if not available
***/
int test_drive( int drive )
{ int result;
char buffer[512];
// do result = biosdisk( 4, drive, 0, 0, 1, 1, buffer );
// while ( result == 0x06 );
/* read */
do result = biosdisk( 2, drive, 0, 0, 1, 1, buffer );
while ( result == 0x06 );
if ( result ) return result;
/* write */
result = biosdisk( 3, drive, 0, 0, 1, 1, buffer );
return result;
}